import java.util.Iterator;
import java.util.*;

public class Test {
    /*
    题目 1 ： W * H 的网格里最多可以放多少块蛋糕
     */
    //要求任意两个蛋糕的距离不等于欧几里得距离2！
    public static void main4(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int W = sc.nextInt();
            int H = sc.nextInt();
            int[][] nums = new int[W][H];
            int count = 0;
            for(int i = 0; i < W; i++){
                for(int j = 0; j < H; j++){
                    if(nums[i][j] != -1){
                        nums[i][j] = 1;
                        count++;
                        if(i + 2 < W){
                            nums[i + 2][j] = -1;
                        }
                        if(j + 2 < H){
                            nums[i][j + 2] = -1;
                        }
                    }
                }
            }
            System.out.print(count);
        }
    }

    /*
    题目 2 ：字符串转成一个整数，不能使用库函数
     */
    public int StrToInt(String str) {
        int sum = 0;
        int count = 0;
        for(int i = str.length() - 1; i >= 1; i--){
            char ch = str.charAt(i);
            if(ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z'){
                return 0;
            }

            sum += (ch - '0') * Math.pow(10, count);
            count++;
        }
        if(str.charAt(0) == '+'){
            return sum;
        }else if(str.charAt(0) == '-'){
            return -sum;
        }else{
            return 0;
        }
    }

    public static void main3(String[] args){
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
        StringBuffer strBuf = new StringBuffer(str1);
        int count = 0;
        for(int i = 1; i < str1.length(); i++){
            strBuf.insert(i, str2);
            String str = strBuf.toString();
            strBuf.reverse();
            if(strBuf.toString().equals(str)){
                count++;
            }
            strBuf.reverse();
            strBuf.delete(i, i + str2.length());
        }
        System.out.print(count);

    }

    public static void main2(String[] args){
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
        StringBuffer strBuf = new StringBuffer(str1);

    }

    public static void main1(String[] args) {
        StringBuffer sb = new StringBuffer("abx");
        sb.insert(sb.length(),"1234");
        System.out.println(sb);

    }
}
